package com.baichen;

public class Main {

    public static void main(String[] args) throws Exception {
        MyInterface proxyInstance = MyInterfaceFactory.createProxyInstance(new NameHandler());
        proxyInstance.func1();
        proxyInstance.func2();
        proxyInstance.func3();
        MyInterface nameHandlerInstance = proxyInstance;
        proxyInstance = MyInterfaceFactory.createProxyInstance(new LogHandler(nameHandlerInstance));
        proxyInstance.func1();
        proxyInstance.func2();
        proxyInstance.func3();
    }
}
